﻿using System;
using System.ComponentModel;
using Loki.UI;
using Loki.UI.Wpf;
using Luna.UI;

namespace Luna.WPF
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : RibbonViewWindow<MainViewModel>
    {
        public MainWindow()
        {
            InitializeComponent();
            dockLayoutManager1.DockItemClosing += dockLayoutManager1_DockItemClosing;
            dockLayoutManager1.DockItemClosed += dockLayoutManager1_DockItemClosed;
            dockLayoutManager1.LayoutItemHidden += dockLayoutManager1_LayoutItemHidden;
            GRP_Group.SelectedItemChanged += GRP_Group_SelectedItemChanged;

            DependencyPropertyDescriptor dpd =
    DependencyPropertyDescriptor.FromProperty(DevExpress.Xpf.Ribbon.ApplicationMenu.IsOpenProperty, typeof(DevExpress.Xpf.Ribbon.ApplicationMenu));
            dpd.AddValueChanged(Menu, IsOpenChanged);
        }

        private static void IsOpenChanged
                        (object d,
                         EventArgs e)
        {
        }

        private void dockLayoutManager1_DockItemClosed(object sender, DevExpress.Xpf.Docking.Base.DockItemClosedEventArgs e)
        {
            // string temp = "";
        }

        private void dockLayoutManager1_DockItemClosing(object sender, DevExpress.Xpf.Docking.Base.ItemCancelEventArgs e)
        {
            // string temp = "";
        }

        private void dockLayoutManager1_LayoutItemHidden(object sender, DevExpress.Xpf.Docking.Base.LayoutItemHiddenEventArgs e)
        {
            // string temp = "";
        }

        private void GRP_Group_SelectedItemChanged(object sender, DevExpress.Xpf.Docking.Base.SelectedItemChangedEventArgs e)
        {
            IViewModel L_ViewModel = DataContext as IViewModel;
            if (L_ViewModel != null)
            {
                L_ViewModel.Activate.Execute(null);
            }
        }
    }
}